const { defineConfig } = require("@vue/cli-service");
const CopyWebpackPlugin = require("copy-webpack-plugin");
const path = require("path");
module.exports = defineConfig({
  transpileDependencies: true,
  publicPath: "/aiassistanted",
	// 打包时不生成.map文件
  productionSourceMap: false,
  devServer: {
    open: true,
    client: {
      overlay: false,
    },
    proxy: {
      "/aiassistanted": {
        // target: "https://test2.citicpruagents.com.cn",
				target: 'http://10.30.38.76:10092',
        changeOrigin: true,
        pathRewrite: {
          // '^/ilmp-aus-ruleexecute-app': '/ilmp-aus-ruleexecute-app',
        //
        },
      },
    },
  },
  configureWebpack: config => {
    const plugins = [
      // 复制静态资源
      new CopyWebpackPlugin({
        patterns: [
          { from: "./src/api/cordova.js", to: "static/js/cordova.js" },
          { from: "./src/imageCase", to: "static/js/imageCase" },
          { from: "./src/js", to: "static/js/js" },
          { from: "./src/lib", to: "static/js/lib" },
          // { from: "./src/imageCase/Cordova/Android/cordova.js", to: "static/js//imageCase/Cordova/Android/cordova.js" },
          // { from: "./src/imageCase/Cordova/sino_plugins.js", to: "static/js/imageCase/Cordova/sino_plugins.js" },
        ]
      })
    ];
    return {
      plugins
    }
  },
});
